<%-- 
    Document   : new
    Created on : 09/04/2012, 11:51:23 PM
    Author     : Oscar
--%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.Vector, com.coneccion.*, java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>registrar local</title>
        <link rel="stylesheet" type="text/css" href="../css/css.css">
        <script language="javascript">
        function valida(form) {
        	
        	if(form.txtlocal.value=="") {
        		alert("Debe ingresar el nombre del local !!");
        		document.forms(0).txtlocal.focus();
        	} 
        	
        	if(form.txtdireccion.value=="") {
        		alert("Debe ingresar la direccion del local !!");
        		document.forms(0).txtdireccion.focus();
        	} 
        	
        	if(form.txtdireccion_map.value=="") {
        		alert("Debe ingresar la direccion del local de Google Maps !!");
        		document.forms(0).txtdireccion_map.focus();
        	} 
        	
        	if(form.txtlocal.value!="" & form.txtdireccion.value!="" & form.txtdireccion_map.value!="") {
        		document.forms(0).submit();
        	}
        	else
        	{
        		document.forms(0).txtlocal.focus();
        	}

        }
    </script>
    </head>
    <body onLoad="javascript:document.forms(0).txtlocal.focus()">
        <div style="background-color:#ECF2F7; width:720px">
<h2><img src="../css/img/papelylapiz.jpg" width="36" height="36"> Nuevo Local</h2>
 <form method="post" action="../localservlet">
 <input type="hidden" name="accion" value="Insertar">
       
<table width="104%" height="232px" style="width: 65%">
	<tr>
		<td width="134" style="width: 134px">Distrito :</td>
		<td width="198" style="width: 155px"><select name='cbodistrito' style="width: 145px">
          <%
                	Vector<String[]> distri = sql.consulta("SELECT coddistrito , distrito FROM distrito");
                	for(int fils=1; fils<distri.size(); ++fils) {
						String[] fila= (String[]) distri.get(fils);
							out.println("<option value='" + fila[0] + "' selected>" + fila[1] + "</option>");
						}
           %>
        </select></td>
	</tr>
	<tr>
	  <td style="width: 134px; height: 26px">Local :</td>
	  <td style="width: 155px; height: 26px">
	    <input type="text" name="txtlocal" style="width:220px"></td>
    </tr>
	<tr>
		<td style="width: 134px; height: 26px">Direccion  : </td>
		<td style="width: 155px; height: 26px"><span style="width: 155px">
		  <input type="text" name="txtdireccion" style="width:320px">
		</span></td>
    </tr>
	<tr>
	  <td style="width: 134px">Direccion Mapa Google  : </td>
	  <td style="width: 155px"><span style="width: 155px; height: 26px">
      <input type="text" name="txtdireccion_map" style="width:320px">
      </span></td>
    </tr>
	<tr>
		<td style="width: 134px">Telefono : </td>
		<td style="width: 155px">
		  <input type="text" name="txttelefono" style="width:80px"></td>
	</tr>
	<tr>
		<td style="width: 134px">&nbsp;</td>
		<td style="width: 155px">&nbsp;</td>
	</tr>
	<tr>
		<td style="width: 134px">&nbsp;</td>
		<td style="width: 155px">&nbsp;</td>
	</tr>
	<tr>
		<td style="width: 134px">&nbsp;</td>
		<td style="width: 155px">&nbsp;</td>
	</tr>
	<tr>
		<td style="width: 134px">&nbsp;</td>
		<td style="width: 155px">&nbsp;</td>
	</tr>
	<tr>
		<td style="width: 134px">&nbsp;</td>
		<td style="width: 155px"><input name="button" type="button" onClick="valida(this.form)" value="Aceptar" />
		&nbsp;&nbsp;
	    <input type="reset" name="Reset" value="Cancelar"></td>
	</tr>
    	<tr>
		<td style="width: 134px"><a href="../index.jsp">-- Regresar</a></td>
		<td style="width: 155px"></td>
	</tr>
</table>
</form>
</div>
    </body>
</html>
